<?php

require_once (get_template_directory() . '/classes/WPage.php');

add_editor_style();
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');

if (function_exists('register_nav_menus')) {
	register_nav_menus(array(
		'header-menu' => 'Header Menu',
	));
}

if (function_exists('register_sidebar')) {
    register_sidebar(array(
        'name' => 'sidebar',
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>',
    ));
}

add_custom_background();

if (!isset($content_width)) $content_width = 500; // The maximum image size in pixels - adjust to suit.

if (!function_exists('display_page')) {
  function display_page () {
    global $wpage;
    $wpage->doctype('xhtml', 'strict');
    $wpage->link(array('../css/bp.screen.css', 'jquery.js'), true);
    $wpage->css('../css/bp.print.css', 'print');
    $wpage->css('../css/bp.ie.css', '', 'lt IE 7');
    $html = '';
    
    /*
    // Blueprint Template Example
    require_once (get_template_directory() . '/classes/Blueprint.php');
    $bp = new Blueprint(24);
    $html .= $bp->page();
    $html .= $bp->row($wpage->get('header')); 
    $html .= $bp->swap(19, 5, $wpage->get('content'), $wpage->get('sidebar'));
    $html .= $bp->row($wpage->get('footer')); 
    $html .= $bp->close(); 
    unset ($bp);
    */
    
    // YUI Template Example
    require_once (get_template_directory() . '/classes/YUI.php');
    $wpage->link(array('../css/bp.screen.css', '../css/bp.yui.css', 'jquery.js'), true);
    $yui = new YUI('950');
    $html .= $yui->page('left', 180, $wpage->get('sidebar')); 
    $html .= $yui->header($wpage->get('header')); 
    $html .= $yui->body($wpage->get('content')); 
    $html .= $yui->footer($wpage->get('footer')); 
    $html .= $yui->close(); 
    unset ($yui); 
    
    
    echo $wpage->display($html);
    ob_end_flush();
  }
}

?>